import QQMapWX from '@/assets/js/qqmap-wx-jssdk.min.js'
export type  Location= {
  latitude: number
  longitude: number
}

export const  qqmapsdk = new QQMapWX({
  key: 'KYHBZ-RQCK2-R2ZUD-CRLXN-ZV5JZ-37FQ4'
});
export const  reverseGeocoder = (location?:Location)=>{//不穿获取当前位置
  return new Promise((resolve,reject)=>{
    qqmapsdk.reverseGeocoder({
      location,
      success:function(result){
          resolve(result)
      },
      fail:function(e){
           reject(e)
      }

    })
  })
}
